Feature selection

What is Feature Selection

= Select a subset of all features for model training, usually in data preprocessing.

Feature Selection methods

There are some of the techniques used for feature selection in data analysis

Method Pros Cons
Intrinsic methods fast and no external selection tool is needed; provide a direction connection between feature selection and the object function model-dependent; the choice of models is limited
Filter methods simple and fast; can capture the large trends in the data tend to select redundant features; ignore relationships among features
Wrapper methods search for a wider variety of features tend to overfit; slow

Intrinsic methods

Filter methods

Wrapper methods

Feature Selection Stability

= checks whether selected features remain important across different samples of the data.

Why it matters

Common approaches

Sparse/Non-sparse Model (Sparse Model) Model type What to track Example stability measure
Sparse Sparse model selected / not selected features selection frequency
Non-sparse Linear non-sparse model coefficient size and sign coefficient variance, sign consistency
Non-sparse Tree-based model feature importance scores rank correlation, top-k overlap
Non-sparse Black-box model permutation importance or SHAP values rank correlation, importance variance

Typical workflow for sparse models

  1. Subsample the training data many times
  2. Fit a sparse model each time
  3. Record which features are selected each time
  4. Calculate selection frequency for each feature
  5. Rank features by how often they are selected

Typical workflow for non-sparse models

  1. Resample the training data many times
  2. Fit the model each time
  3. Calculate feature importance each time, e.g. coefficients, permutation importance, tree-based importance, or SHAP values
  4. Compare feature rankings or top-k important features across resamples
  5. Check whether the same features remain consistently important
Important

A model can have stable performance but unstable selected features, especially when features are highly correlated.